package com.andkrup.web.application {
	import com.andkrup.web.ui.IUiManager;	
	import com.andkrup.web.navigation.Navigator;	
	
	import flash.display.Sprite;
	
	import com.andkrup.web.application.IMainApplication;
	
	/**
	 * @author Andkrup
	 */
	public class MainApplication extends Sprite implements IMainApplication {
		private var mLoader : IMainLoader;
		private var uiMan : IUiManager;
		private var nav : Navigator;
		
		public function get mainLoader():IMainLoader{
			return mLoader;
		}
		public function set mainLoader(value:IMainLoader):void{
			mLoader = value;
		}
		public function get uiManager():IUiManager{
			return uiMan;
		}
		public function set uiManager(value:IUiManager):void{
			uiMan = value;
		}
		public function get navigator():Navigator{
			return nav;
		}
		public function set navigator(value:Navigator):void{
			nav = value;
		}

		public function MainApplication() {
			// calling this method ensures that subclasses are reminded to override the method
			includeDefinitions();
		}
		
		/**
		 * "Abstract" template method. See IMainApplication
		 * 
		 */
		public function includeDefinitions():void{
			throw new Error("MainApplication:> includeDefinitions() override and include types to instantiate dynamically");
		}
	}
}
